/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Table_online_saver;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;

/**
 *
 * @author Klu12
 */
@Embeddable
public class ContactBookingPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_contact")
    private int idContact;
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_booking")
    private int idBooking;

    public ContactBookingPK() {
    }

    public ContactBookingPK(int idContact, int idBooking) {
        this.idContact = idContact;
        this.idBooking = idBooking;
    }

    public int getIdContact() {
        return idContact;
    }

    public void setIdContact(int idContact) {
        this.idContact = idContact;
    }

    public int getIdBooking() {
        return idBooking;
    }

    public void setIdBooking(int idBooking) {
        this.idBooking = idBooking;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idContact;
        hash += (int) idBooking;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ContactBookingPK)) {
            return false;
        }
        ContactBookingPK other = (ContactBookingPK) object;
        if (this.idContact != other.idContact) {
            return false;
        }
        if (this.idBooking != other.idBooking) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.ContactBookingPK[ idContact=" + idContact + ", idBooking=" + idBooking + " ]";
    }
    
}
